import java.util.HashSet;
import java.util.Set;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: 冯若航
 * \* Date: 2021/5/6
 * \* Time: 20:18
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class 扑克牌中的顺子 {
    public boolean isStraight(int[] nums){
        Set<Integer> repeat=new HashSet<>();
        int max=0,min=14;
        for(int i:nums){
            if(i==0){
                continue;
            }
            max=Math.max(max,i);
            min=Math.min(min,i);
            if(repeat.contains(i)){
                return false;
            }
            repeat.add(i);
        }
        return max-min<5;
    }
}